SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS OFF 
GO






ALTER     procedure [dbo].[p_modifybprint] 
@btype int,
@bid int,
@bcode varchar(40),
@bdate datetime,
@create_by int,
@filid int
as
begin

  if (not exists(select * from tb_bprint where btype=@btype and bid=@bid))
    insert into tb_bprint values (@btype, @bid, 0,@bcode,@bdate,@create_by,GetDate(),@filid,@create_by,GetDate())
  else
    update tb_bprint set printed=0,bcode=@bcode,bdate=@bdate,create_by=@create_by, filid=@filid  where btype=@btype and bid=@bid

end





GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

